/**
 * 
 */
package adnotatio.common.xml;

/**
 * The wrapper for a XML text node.
 * 
 * @author kotelnikov
 */
public abstract class XMLText extends XMLNode {

    /**
     * Common constructor initializing this wrapper.
     * 
     * @param document the XML document
     * @param node the real wrapped node
     */
    public XMLText(XMLDocument document, Object node) {
        super(document, node);
    }

    /**
     * Returns the text content corresponding to this node
     * 
     * @return the text content corresponding to this node
     */
    public String getText() {
        return getText(fNode);
    }

    /**
     * Returns the text content of the given internal XML node
     * 
     * @param node the internal XML node for which the corresponding content
     *        should be returned
     * @return the text content of the given internal XML node
     */
    protected abstract String getText(Object node);

}
